#include "SubjectA.h"
#include <QDebug>

#include ".\UI\ModRun\Output\FactoryOutput.h"

SubjectA::SubjectA()
{
    m_strName = "SubjectA";
    m_strStatus = QString::fromStdString("");

    QString strOutput = m_strName + " 构造";
    qDebug() << strOutput;
    std::shared_ptr<IOutput> pOutPut = FactoryOutput::GetInstance()->CreateRunOutput();
    if (pOutPut)
    {
        std::initializer_list<QString> outList{ strOutput };
        pOutPut->OutPut(outList);
    }

}

SubjectA::~SubjectA()
{
    QString strOutput = m_strName + " 析构";
    qDebug() << strOutput;
    std::shared_ptr<IOutput> pOutPut = FactoryOutput::GetInstance()->CreateRunOutput();
    if (pOutPut)
    {
        std::initializer_list<QString> outList{ strOutput };
        pOutPut->OutPut(outList);
    }
}

//设置State;
void SubjectA::SetStatus(QString strStatus)
{
    m_strStatus = strStatus;

    Notify(strStatus);
}

//获取State;
QString SubjectA::GetStatus()
{
    return m_strStatus;
}
